<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Graph demo</title>

    <style>
        body {font: 10pt arial;}
    </style>

    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript" src="../graph.js"></script>
    <!--[if IE]><script src="../excanvas.js"></script><![endif]-->
    <link rel="stylesheet" type="text/css" href="../graph.css">

    <script type="text/javascript">
        var graph = null;
        var functionNum = 16;

        google.load("visualization", "1");

        // Set callback to run when API is loaded
        google.setOnLoadCallback(drawVisualization);

        // Called when the Visualization API is loaded.
        function drawVisualization() {
            // Create and populate a data table.
            var data = new google.visualization.DataTable();
            data.addColumn('datetime', 'time');
            for (var j = 0; j < functionNum; j++) {
                data.addColumn('number', 'Function ' + (j+1) );
            }

            // create data
            var d = new Date(2010, 9, 23, 20, 0, 0);
            for (var i = 0; i < 500; i++) {
                var row = [];
                row.push(new Date(d));

                for (var j = 0; j < functionNum; j++) {
                    var value = Math.sin((i) / 50 - j * Math.PI / functionNum) * 10 + 5;
                    row.push(value);
                }
                data.addRow(row);

                d.setMinutes(d.getMinutes() + 1);
            }

            // specify options
            var options = {width:  "100%",
                height: "300px",
                line: {width: 2.0},   // apply width to all lines
                lines:                // apply styles for specific lines
                        [
                            {visible: true},
                            {visible: false},
                            {visible: false}
                        ],
                legend: {toggleVisibility: true}
            };

            // Instantiate our graph object.
            graph = new links.Graph(document.getElementById('mygraph'));

            // Draw our graph with the created data and options
            graph.draw(data, options);
        }
    </script>
</head>

<body>
<div id="mygraph"></div>

<div id="info"></div>
</body>
</html>
